package com.hktf.corelib.utils;

import android.database.Cursor;

import java.io.Closeable;

/**
 * Created by Administrator on 2016/6/23.
 */
public class IOUtils {


    private IOUtils() {
    }

    public static void closeQuietly(Closeable closeable) {
        if (closeable != null) {
            try {
                closeable.close();
            } catch (Throwable e) {
            }
        }
    }

    public static void closeQuietly(Cursor cursor) {
        if (cursor != null) {
            try {
                cursor.close();
            } catch (Throwable e) {
            }
        }
    }
    /**
     * 关闭流
     */
    public static boolean close(Closeable io) {
        if (io != null) {
            try {
                io.close();
            } catch (Exception e) {
                LogUtils6.e(e);
            }
        }
        return true;
    }

}
